package sifeap.entities.solicitudescredito;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Cacheable;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import sifeap.entities.soportes.Soporte;


/**
 * The persistent class for the codeudores database table.
 * 
 */
@Entity
@Cacheable(false)
@Table(name="codeudores", schema="sifeap")
public class Codeudor implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name = "IDCODEUDOR_GENERATOR", sequenceName = "seq_codeudores", schema="sifeap", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "IDCODEUDOR_GENERATOR")
	@Column(unique=true, nullable=false, precision=8)
	private Long idCodeudor;

	@Column(name="descripcionotrosing", length=128)
	private String descripcionOtrosIngresos;

	@Column(precision=10)
	private Long otrosIngresos;

	@Column(nullable=false, length=15)
	private String vincedula;

	//bi-directional many-to-one association to SolicitudCredito
	@ManyToOne
	@JoinColumn(name="idsolicitudcredito", nullable=false)
	private SolicitudCredito solicitudescredito;

	//bi-directional many-to-many association to Soporte
	@ManyToMany(mappedBy="codeudores")
	private List<Soporte> soportes;

	public Codeudor() {
	}

	public Long getIdCodeudor() {
		return this.idCodeudor;
	}

	public void setIdCodeudor(Long idCodeudor) {
		this.idCodeudor = idCodeudor;
	}

	public String getDescripcionOtrosIngresos() {
		return this.descripcionOtrosIngresos;
	}

	public void setDescripcionOtrosIngresos(String descripcionOtrosIngresos) {
		this.descripcionOtrosIngresos = descripcionOtrosIngresos;
	}

	public Long getOtrosIngresos() {
		return this.otrosIngresos;
	}

	public void setOtrosIngresos(Long otrosIngresos) {
		this.otrosIngresos = otrosIngresos;
	}

	public String getVincedula() {
		return this.vincedula;
	}

	public void setVincedula(String vincedula) {
		this.vincedula = vincedula;
	}

	public SolicitudCredito getSolicitudescredito() {
		return this.solicitudescredito;
	}

	public void setSolicitudescredito(SolicitudCredito solicitudescredito) {
		this.solicitudescredito = solicitudescredito;
	}

	public List<Soporte> getSoportes() {
		return this.soportes;
	}

	public void setSoportes(List<Soporte> soportes) {
		this.soportes = soportes;
	}

}